<?php
// 消息中心
namespace app\shop\controller;

use think\Session;
use think\Controller;
use app\shop\model\MemberMessage as MemberMessageModel;

class News extends Controller
{
    /**
     * 消息中心
     */
    public function index()
    {
        // 获取会员ID
        // $userId = Session::get('member_id');
        $userId = 1;
        // 获取会员的信息
        $message = (new MemberMessageModel())->where(['member_id' => $userId])->order(['create_time' => 'desc'])->paginate(5,false);


        return $this->fetch('', [
            'mate_head' => '消息中心',
            'message' => $message
        ]);
    }
}